API Documentation
Public Member Functions | List of all members
nkGraphics::RenderContextManager Class Referencefinal

Manages the rendering contexts available in the component. More...

Inheritance diagram for nkGraphics::RenderContextManager:

Public Member Functions

 ~RenderContextManager ()
 
const std::unordered_map< void *, RenderContext * > & getRenderContextMap () const
 
RenderContextgetRenderContextOf (nkWinUi::GraphicsWindow *win) const
 
RenderContextgetActiveRenderContext () const
 
RenderContextgetDefaultRenderContext () const
 
RenderContextcreateRenderContext (const RenderContextDescriptor &contextDesc)
 
RenderContextcreateRenderContextAndWindowFromConfig ()
 
void activateContextOf (nkWinUi::GraphicsWindow *win)
 
void activateContext (RenderContext *context)
 
void eraseFor (nkWinUi::GraphicsWindow *win)
 
void erase (RenderContext *context)
 

Detailed Description

Manages the rendering contexts available in the component.

The manager is responsible for the memory it allocates. External code should not delete it.

Constructor & Destructor Documentation

◆ ~RenderContextManager()

nkGraphics::RenderContextManager::~RenderContextManager ( )

Destructor.

Member Function Documentation

◆ getRenderContextMap()

const std::unordered_map<void*, RenderContext*>& nkGraphics::RenderContextManager::getRenderContextMap ( ) const
Returns
Internal context map, used for tracking.

◆ getRenderContextOf()

RenderContext* nkGraphics::RenderContextManager::getRenderContextOf ( nkWinUi::GraphicsWindow *  win) const

Retrieves the context associated to a window.

Parameters
winThe window which context is needed.
Returns
The context associated to given window if available, nullptr else.

◆ getActiveRenderContext()

RenderContext* nkGraphics::RenderContextManager::getActiveRenderContext ( ) const
Returns
The active render context.

◆ getDefaultRenderContext()

RenderContext* nkGraphics::RenderContextManager::getDefaultRenderContext ( ) const
Returns
The default render context.

◆ createRenderContext()

RenderContext* nkGraphics::RenderContextManager::createRenderContext ( const RenderContextDescriptor contextDesc)

Creates a render context. Depending on the description, the context will be rendering to a window, or a texture. Based on the description, the window / texture will be created on-the-fly or taken from user specified pointers.

Parameters
contextDescThe description of the context to create.
Returns
A freshly created context. The manager owns the memory, external code should not delete it.

◆ createRenderContextAndWindowFromConfig()

RenderContext* nkGraphics::RenderContextManager::createRenderContextAndWindowFromConfig ( )

Creates a render context and its window, from the configuration currently set. See ConfigManager.

Returns
A freshly created context. The manager owns the memory, external code should not delete it.

◆ activateContextOf()

void nkGraphics::RenderContextManager::activateContextOf ( nkWinUi::GraphicsWindow *  win)

Activates a context and prepares the rendering pipeline for all its defined parameters.

Parameters
winThe window from which the context should be activated.

◆ activateContext()

void nkGraphics::RenderContextManager::activateContext ( RenderContext context)

Activates a context and prepares the rendering pipeline for all its defined parameters.

Parameters
contextThe context to activate.

◆ eraseFor()

void nkGraphics::RenderContextManager::eraseFor ( nkWinUi::GraphicsWindow *  win)

Erases and frees the memory of a context.

Parameters
winThe window from which the context should be deleted.

◆ erase()

void nkGraphics::RenderContextManager::erase ( RenderContext context)

Erases and frees the memory of a context.

Parameters
contextThe context to free.

The documentation for this class was generated from the following file: